package AtCoderBeginnerContest353;

import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		int ret = 0;
		
		int[] a = new int[n + 10];
		for(int i = 1; i <= n; i ++ ) {
			a[i] = sc.nextInt();
		}
		
		int t = 0;
		for(int i = 1; i <= n; i ++ ) {
			if(t + a[i] <= k) {
				t += a[i];
			} else {
				t = a[i];
				ret ++;
			}
		}
		//System.out.print("t = " + t);
		ret ++;
		System.out.println(ret);
	}
}
